

@RestController
@RequestMapping("/fmsMaterialCategory")
public class FmsMaterialCategoryController {

    @Resource
    private FmsMaterialCategoryService fmsMaterialCategoryService;


    /**
     * 获取 FmsMaterialCategory 分页列表
     */
    @GetMapping("/pagination")
    public Ret getFmsMaterialCategoryPagination( PaginationVo paginationVo, FmsMaterialCategoryQuery fmsMaterialCategoryQuery ) throws Exception {
        IPage page = fmsMaterialCategoryService.getFmsMaterialCategoryPagination(paginationVo, fmsMaterialCategoryQuery );
        return Ret.toPage(page);
    }


    /**
     * 获取 FmsMaterialCategory 所有数据
     */
    @GetMapping("/all")
    public Ret getFmsMaterialCategoryAllList( FmsMaterialCategoryQuery fmsMaterialCategoryQuery ) throws Exception {
        List<FmsMaterialCategoryEntity> list = fmsMaterialCategoryService.getFmsMaterialCategoryAllList( fmsMaterialCategoryQuery );
        return Ret.ok(list);
    }



    /**
     * 获取 FmsMaterialCategory 详情
    */
   @GetMapping("/{id}")
   public Ret getFmsMaterialCategoryDetail(@PathVariable Long id) throws Exception {

       FmsMaterialCategoryEntity fmsMaterialCategory = fmsMaterialCategoryService.getFmsMaterialCategoryDetail(id);
       return Ret.ok(fmsMaterialCategory);
   }


    /**
     * 新增 FmsMaterialCategory
     * */
    @PostMapping("")
    public Ret addFmsMaterialCategory(@RequestBody FmsMaterialCategoryVo fmsMaterialCategoryVo) throws Exception {

        fmsMaterialCategoryService.addFmsMaterialCategory(fmsMaterialCategoryVo);
        return Ret.ok();
    }


    /**
     * 更新 FmsMaterialCategory
     * */
    @PutMapping("")
    public Ret updateFmsMaterialCategory(@RequestBody FmsMaterialCategoryVo fmsMaterialCategoryVo) throws Exception {

        fmsMaterialCategoryService.updateFmsMaterialCategory(fmsMaterialCategoryVo);
        return Ret.ok();
    }


    /**
     * 删除 FmsMaterialCategory
     * */
    @PostMapping("/batchRemove")
    public Ret batchRemoveFmsMaterialCategory( @RequestBody List<Long> ids ) throws Exception {

        fmsMaterialCategoryService.batchRemoveFmsMaterialCategory(ids);
        return Ret.ok();
    }
}

  